getOrDefault

open fun getOrDefault(key: K, defaultValue: @UnsafeVariance V): V

Returns the value corresponding to the given key, or defaultValue if such a key is not present in the map.

Since

JDK 1.8

Since Kotlin

1.1